﻿using MediatR;
using RBAC.LuFang.API.Application.Command.RoleMenuCommand;
using RBAC.LuFang.Domain.DTO;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.RoleMenuHandler
{
    //角色菜单反填
    public class RoleMenuFanCommandHandler:IRequestHandler<RoleMenuFanCommand, List<FanMenuDTO>>
    {
        private readonly IRoleMenuService _rolemenuService;

        public RoleMenuFanCommandHandler(IRoleMenuService rolemenuService)
        {
            _rolemenuService = rolemenuService;
        }

        public async Task<List<FanMenuDTO>> Handle(RoleMenuFanCommand request, CancellationToken cancellationToken)
        {
            return await _rolemenuService.FanMenu(request.rid);
        }
    }
}
